!function ($) {
  const banner = $('.banner');
  const imglist = $('.banner>a');
  const yuandian = $('.yuan li');
  const left = $('.prev');
  const right = $('.next');
  let num = null;


  // 轮播图
  yuan.on('mouseover', function () {
    num = $(this).index();
    comRemove();
    $(this).css("cursor", "pointer");
  });
  banner.hover(function () {
    clearInterval(timer);
  },
    function () {
      timer = setInterval(() => {
        right.click();
      }, 3000)
    }
  );
  left.on('click', function () {
    num--;
    if (num < 0) {
      num = yuan.length - 1;
    }

    comRemove();

  });
  right.on('click', function () {
    num++;
    if (num > yuan.length - 1) {
      num = 0;
    }

    comRemove();

  });
  function comRemove() {

    yuan.eq(num).addClass('dian_show').siblings('li').removeClass('dian_show');
    imglist.eq(num).animate({ opacity: 1 }, 300).siblings('a').animate({ opacity: 0 });
  }
  timer = setInterval(() => {
    right.click();
  }, 3000);
}  